package bookstudytest.date.newversion;

import java.time.Clock;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;

/**
 * @Author li.heng
 * @Date 2019/6/25 14
 * @Description:
 **/
public class LocalDateTimeDemo {
    public static void main(String[] args) {

    }

    public static void getInstance(String str) {
        LocalDateTime of = LocalDateTime.of(1992, 2, 3, 23, 12, 3);
        LocalDateTime of1 = LocalDateTime.of(LocalDate.now(), LocalTime.now());
        LocalDate localDate = of1.toLocalDate();
        LocalTime localTime = of1.toLocalTime();
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String format = now.format(dateTimeFormatter);
        String dateTimeStr = "1992-11-02 11:32:23";
        TemporalAccessor parse = dateTimeFormatter.parse(dateTimeStr);
        LocalDateTime from = LocalDateTime.from(parse);

    }


}
